﻿using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using AgileConfig.Server.Data.Entity;

namespace AgileConfig.Server.Apisite.Models;

public interface IAppIdModel
{
    string AppId { get; set; }
}

[ExcludeFromCodeCoverage]
public class ConfigVM : IAppIdModel
{
    public string Id { get; set; }

    [MaxLength(100, ErrorMessage = "配置组长度不能超过100位")]
    public string Group { get; set; }

    [Required(ErrorMessage = "配置键不能为空")]
    [MaxLength(100, ErrorMessage = "配置键长度不能超过100位")]
    public string Key { get; set; }

    [MaxLength(4000, ErrorMessage = "配置值长度不能超过4000位")]
    public string Value { get; set; }

    [MaxLength(200, ErrorMessage = "描述长度不能超过200位")]
    public string Description { get; set; }

    public OnlineStatus OnlineStatus { get; set; }
    public ConfigStatus Status { get; set; }

    [Required(ErrorMessage = "应用Id不能为空")]
    [MaxLength(36, ErrorMessage = "应用Id长度不能超过36位")]
    public string AppId { get; set; }
}